Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate LatLngBounds to nullsafety #1431

Conversation

TesteurManiak
Copy link
Collaborator

BREAKING CHANGES

Updated LatLngBounds constructor and its methods to rely on non-nullable values.

Migration guide

BAD:

final bounds = LatLngBounds();
bounds.extend(dublin);
bounds.extend(paris);
bounds.extend(london);

GOOD:

final bounds = LatLngBounds.fromPoints([dublin, paris, london]);

And all method related to the LatLngBounds now relies on non-nullable parameters and returns non-nullable values:

  • LatLngBounds: takes 2 LatLng parameters instead of LatLng?
  • extend(): takes a LatLng instead of LatLng?
  • southWest: returns a LatLng instead of LatLng?
  • northEast: returns a LatLng instead of LatLng?
  • isValid: became deprecated as it'll always be true
  • contains(): takes a LatLng instead of LatLng?
  • isOverlapping(): takes a LatLngBounds instead of LatLngBounds?

I've added some unit tests to ensure that the values are still relevant even after the migration.

Copy link
Member

@JaffaKetchup JaffaKetchup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks :)

@JaffaKetchup JaffaKetchup merged commit f558e43 into fleaflet:master Feb 5, 2023
@TesteurManiak TesteurManiak deleted the feat/migrate-latlngbounds-to-nullsafety branch February 16, 2023 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants